package com.addedstuff;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;

public class Revolver extends Item 
{
//causes and explosive blast that blows a hole with 300 damage
	public Revolver(int par1, EnumToolMaterial par2enumtoolEnumToolMaterial) 
	{
			super(par1);
			this.setCreativeTab(CreativeTabs.tabCombat);
			// TODO Auto-generated constructor stub
	}

	public void registerIcons(IconRegister iconReg)
	{
	    itemIcon = iconReg.registerIcon("Brianmodbase:Revolver");
	}
	
	public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
	{
		MovingObjectPosition corrdinate=par3EntityPlayer.rayTrace(300, 1);
		if (corrdinate != null)
		{
			par2World.createExplosion(par3EntityPlayer, corrdinate.blockX, corrdinate.blockY, corrdinate.blockZ, 50, true);
		}
		return par1ItemStack;
	}

}